﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RestSharp;
using Ymatou.API.Common;
using Ymatou.Evaluate.Seller.Model.ApiModel.Response.Query;
using Ymatou.ServiceCenter;

namespace Ymatou.Evaluate.Seller.Model.ApiModel.Request.Query
{
    [Resource("evaluate.iapi.ymatou.com", "api/query/GetEvaluateCount", Method.GET, ParameterBuildType.Json)]
    public class GetEvaluateCountRequest : BaseRequestModel<GetEvaluateCountResponse>
    {
        public override string ApiName { get { return "api/query/GetEvaluateCount"; } }
        public override bool HttpGet { get { return true; } }

        /// <summary>
        /// 买手Id
        /// </summary>
        public int SellerId { get; set; }

        /// <summary>
        /// 基准评分（统计低于该分值的总数）
        /// </summary>
        public decimal Score { get; set; }

        public override void Validate()
        {
            const string errCode = "-1";
            if (SellerId <= 0)
            {
                throw new BussniessException(errCode, "非法卖家Id");
            }
            if (Score < 0 || Score > 5)
            {
                throw new BussniessException(errCode, "商品评分应大于0小于等于5");
            }
            base.Validate();
        }
    }
}
